<template>
  <div>
    <hu-table
      ref="table"
      :tableData="tableData"
      :tableCol="tableCol"
      :loading="MixinLoading"
    >
      <template v-slot:groupName="{ row }">
        <input type="text" v-model="row.groupName" />
      </template>
    </hu-table>
    <button @click="getTable">按钮</button>
  </div>
</template>

<script>
import * as http from "@/api/test.js";
export default {
  data() {
    return {
      // table Col
      tableCol: [
        {
          type: "selection",
          width: "55",
        },
        {
          title: "序号",
          key: "index",
        },
        {
          title: "部门",
          key: "name",
          children: [
            {
              title: "部门1",
              key: "name",
            },
            {
              title: "部门2",
              key: "name1",
            },
            {
              title: "部门3",
              key: "name2",
            },
          ],
        },
        {
          title: "班组",
          slot: "groupName",
          // required: true,
        },
        {
          title: "名称",
          slot: "minche",
          function: (row) => {
            return row;
          },
        },
      ],
      tableData: [], // table Data
    };
  },
  methods: {
    getTable() {
      if (this.$refs.table.verifyTable()) return;
      let params = {
        page: 1,
        limit: 10,
      };
      this.HandleRequestQuery(http.getList, params, this.MixinSetLoading).then(({ result }) => {
        this.tableData = [{ name: "name", name1: "name1", name2: "name2" }];
      });
      this.HandleRequestSubmit(http.getList, params, '自定义提示').then(({ result }) => {
        this.showModal = false;
        this.getList();
      });
    },
    getList() {
      console.log("获取列表");
    },
  },
};
</script>

<style></style>
